package main

import (
	"errors"
	"fmt"
	"time"

	"gitee.com/knowgo/gotool/errs"
	"gitee.com/knowgo/logo"
	"gitee.com/knowgo/logo/log"
)

func main() {
	var e = errs.NewTextError("abc")
	var err = fmt.Errorf("new:%w", e)
	var nn = errs.ParseTextError(errors.New("p"), "ok")
	fmt.Println(err, nn)

	logger := log.GetDefaultLogger()
	logger.SetLevel(logo.LevelDebug)
	// logger.SetFormatter(logo.JSONFormatter)
	logger.SetLogFileLine(true)
	// logger.SetPrinters(logo.NewStdPrinters())
	// log.SetLogErrorCallStacks(true)
	log.With(123).Debug("111")
	// runtime.Compiler
	log.Infof("os.Getegid()")
	log.With("aaa").With(errs.NewStackError("122222")).Warn("111")
	logger.Error(errs.NewStackError("123"))

	// err := logo.NewStackError("123")
	// fmt.Println(err.Error())

	time.Sleep(time.Second)
}
